package com.sample.consumer;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.sample.dto.OrderDTO;
import com.sample.service.OrderService;
import com.swak.annotation.rabbit.RabbitSubscriber;
import com.swak.rabbit.message.Message;

/**
 * 订单消费
 * 
 * @author 618lf
 */
@Service
public class OrderConsumer {

	@Autowired
	private OrderService orderService;

	@RabbitSubscriber(queue = "Order_queue")
	public void order(Message message) {
		OrderDTO order = message.payload2Object();
		this.orderService.complete(order);
	}
}